
export function fetchList (query) {
  return {
    url: 'dict/page',
    method: 'get',
    data: query
  }
}

export function addObj (obj) {
  return {
    url: 'dict/create',
    method: 'post',
    data: obj
  }
}

export function editObj (obj) {
  return {
    url: 'dict/update',
    method: 'post',
    data: obj
  }
}

export function putObj (obj) {
  return {
    url: 'dict/',
    method: 'put',
    data: obj
  }
}

export function getObj (id) {
  return {
    url: 'dict/' + id,
    method: 'get'
  }
}

export function getChild (id) {
  return {
    url: 'dict/child/' + id,
    method: 'get'
  }
}

export function postChild (obj) {
  return {
    url: 'dict/child/create',
    method: 'post',
    data: obj
  }
}

export function putChild (obj) {
  return {
    url: 'dict/child/update',
    method: 'post',
    data: obj
  }
}

export function deleteChildById (id) {
  return {
    url: `dict/child/delete/${id}`,
    method: 'post'
  }
}

export function delObj (id) {
  return {
    url: 'dict/delete/' + id,
    method: 'post'
  }
}

export function remote (type) {
  return {
    url: 'dict/type/' + type,
    method: 'get'
  }
}

export const loadAllDictMap = () => {
  return {
    url: 'dict/all_map',
    method: 'get'
  }
}
